package nowcode

var stack1 []int // 用来进
var stack2 []int // 用来出

func Push(node int) {

	for i := len(stack2) - 1; i >= 0; i-- {
		stack1 = append(stack1, stack2[i])
	}

	stack2 = []int{}

	stack1 = append(stack1, node)

}

func Pop() int {

	for i := len(stack1) - 1; i >= 0; i-- {
		stack2 = append(stack2, stack1[i])
	}

	stack1 = []int{}

	res := stack2[len(stack2)-1]

	stack2 = stack2[:len(stack2)-1]
	return res
}
